function tone = makeTone(frequency, duration, samplingRate)
	if ~exist('samplingRate', 'var')
		samplingRate = frequency * 2;
	end

	assert(30 <= frequency && frequency <= 30000, 'frequency out of range');
	assert(samplingRate >= frequency * 2, ...
		'The sampling rate should be twice as large as frequency');

	tone = sin(linspace(0, duration * frequency * 2 * pi, round(samplingRate * duration)));
end
